<?php
namespace app\post\controller\admin;
use app\common\controller\Admin;
use app\common\traits\ControllerCurd;
use think\Request;
use app\common\annotation\NodeAnnotation;
/**
 * @NodeAnnotation(
 *     title="门户应用配置",
 *     parent="post/admin.index",
 *     is_menu=0,
 *     is_view=0,
 *     auth=1
 * )
 */
class Setting extends Admin
{
    /**
     * @NodeAnnotation(
     *     title="设置管理",
     *     parent="post/admin.setting",
     *     MenuRoot="post/admin.index"
     * )
     */
    public function set(Request $request)
    {
        $downloadSetting = get_user_option("download_setting",_get_current_admin_id());

        if ($request->isPost())
        {
            $uploadSetting = $this->request->post();
            set_user_option('download_setting', $uploadSetting,_get_current_admin_id());
            $this->success('设置成功！');
        }

        $this->assign([
            "download_setting" => $downloadSetting
        ]);

        return $this->fetch();
    }


}